#def make_a_dictionary():
#    new_dict = {"Tim": 1, "Adnan": 2, "Hansi": 3}  # 直接按照要求创建字典，键为名字，值为对应的数字
#    return new_dict
#the_dict = make_a_dictionary()
#print(the_dict)
#contacts_dict = {
#    'Alice': '555-1234567',
#    'Bob': '555-3141592',
#    'Eve': '555-1596324',
#    'Mallory': '555-9876543'
#    }
#print(contacts_dict.get('Eve'))
#print(contacts_dict.items())
#print(contacts_dict['Bob'])
#del contacts_dict['Mallory']
#for each_key in contacts_dict.keys():
#    print(f'Key: {each_key}')
#for each_value in contacts_dict.values():
#    print(f'Value: {each_value}')
#for each_key, each_value in contacts_dict.items():
#    print(f'Key {each_key} has a value of {each_value}')
contacts_dict = {
    'Alice': '555-1234567',
    'Bob': '555-3141592',
    'Eve': '555-1596324',
    'Mallory': '555-9876543'
    }

print(contacts_dict['Bob'])
not_present_msg = 'Key is not present in the dictionary'
key_val = 'Tim'
print(f"{key_val}: {contacts_dict.get(key_val,not_present_msg)}")
